import java.util.*;

public class Test {
    public static void main(String[] args) {
        //point类测试
        Point p=new Point();
        System.out.println("x="+p.x+" "+"y="+p.y);
        System.out.print("请输入x,y:>");
        Scanner scan=new Scanner(System.in);
        int x=scan.nextInt();
        int y=scan.nextInt();
        Point p1=new Point(x,y);
        double dis=p.distance(p1);
        System.out.println(dis);
        //circle类测试
        Circle p4=new Circle();
        System.out.println("半径:>"+p4.getR());
        double s4=p4.area();
        System.out.println("面积:>"+s4);
        double c4=p4.perimeter();
        System.out.println("周长:>"+c4);
        System.out.println();

        Circle p2=new Circle(1,1,10);
        System.out.println("半径:>"+p2.getR());
        //面积和周长测试
        double s2=p2.area();
        System.out.println("面积:>"+s2);
        double c2=p2.perimeter();
        System.out.println("周长"+c2);
        System.out.println();

        Circle p3=new Circle(1,1,-1);
        System.out.println("半径:>"+p3.getR());
        double s3=p3.area();
        System.out.println("面积:>"+s3);
        double c3=p3.perimeter();
        System.out.println("周长:>"+c3);
        System.out.println();

        Point p5=new Point(1,1);
        Circle c1=new Circle(p5,10);
        System.out.println("半径:>"+c1.getR());
        double s5=c1.area();
        System.out.println("面积:>"+s5);
        double c5=c1.perimeter();
        System.out.println("周长:>"+c5);
        System.out.println();

        Point p6=new Point(1,1);
        Circle c6=new Circle(p6,-1);
        System.out.println("半径:>"+c6.getR());
        double s6=c6.area();
        System.out.println("面积:>"+s6);
        double C6=c6.perimeter();
        System.out.println("周长:>"+C6);
        System.out.println();

        Point p7=new Point(1,1);
        Circle c7=new Circle(null,10);
        System.out.println("半径:>"+c7.getR());
        double s7=c7.area();
        System.out.println("面积:>"+s7);
        double C7=c7.perimeter();
        System.out.println("周长:>"+C7);
        System.out.println();

        //关系测试
        Circle a1=new Circle();
        Circle a2=new Circle(0,0,0);
        int tmp1=a1.relation(a2);
        if(tmp1==-1){
            System.out.println("error");
        }

        Circle a3=new Circle();
        Circle a4=new Circle(0,0,1);
        int tmp2=a3.relation(a4);
        if(tmp2==-1){
            System.out.println("error");
        }

        Circle a5=new Circle(0,0,10);
        Circle a6=new Circle(1,1,5);
        int tmp3=a5.relation(a6);
        if(tmp3==-1){
            System.out.println("error");
        }

        Circle a7=new Circle(0,0,10);
        Circle a8=new Circle(0,5,10);
        int tmp4=a7.relation(a8);
        if(tmp4==-1){
            System.out.println("error");
        }

        Circle a9=new Circle(0,0,10);
        Circle a10=new Circle(0,20,10);
        int tmp5=a9.relation(a10);
        if(tmp5==-1){
            System.out.println("error");
        }
    }
}
